package com.example.demo02.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo02.mapper.SupplierMapper;
import com.example.demo02.entity.Supplier;
import com.example.demo02.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * (Supplier)表服务实现类
 *
 * @author makejava
 * @since 2024-09-01 21:10:18
 */
@Service("supplierService")
public class SupplierService extends ServiceImpl<SupplierMapper, Supplier>{

    @Autowired
    private SupplierMapper supplierMapper; // 假设你有一个 MyBatis Mapper

    public String getSupplierNameById(Integer supplierId) {
        Supplier supplier = supplierMapper.selectById(supplierId);
        return supplier != null ? supplier.getSupplierName() : null;
    }
}


